package actions;

import java.sql.SQLException;
import java.util.ArrayList;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.sql.RowSet;

import model.ReviewerModel;
import model.StudentModel;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import db.DbException;

public class DecisionAction extends Action {

    public ActionForward execute(ActionMapping mapping, ActionForm form,
            HttpServletRequest request, HttpServletResponse response)
            throws DbException {
        int studentid = 0;
        studentid = (Integer)request.getSession(false).getAttribute("studentid");

        String decision = "";
        // take decision from request object
        decision = request.getParameter("decision");
        
        // WRITE THE QUERY FOR THIS UPDATE FOR THE STUDENT DECISION
        StudentModel.setDecision(studentid, decision);
        
                        
        return mapping.findForward("success");
    }
}
